package com.key.w8.common.util;

/**
 * @Author: k8
 * @CreateTime: 2025-03-27
 * @Version: 1.0
 */
public class StrUtil {
    public static boolean isNotEmpty(String s){
        if (s==null || s.isEmpty()) return false;
        return true;
    }
    public static boolean isEmpty(String s){
        if (s==null || s.isEmpty()) return true;
        return false;
    }

    public static boolean isBlank(String str) {
        if (str == null) {
            return true;
        }
        int length = str.length();
        for (int i = 0; i < length; i++) {
            if (!Character.isWhitespace(str.charAt(i))) {
                return false;
            }
        }
        return true;
    }

    public static String format(String s, String[] strings) {
        String formattedTemplate = s.replace("{}", "%s");
        return String.format(formattedTemplate, strings);
    }
}
